<!-- Study_CompetitiveProductsCommentDelete.html -->
<!DOCTYPE HTML>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<title>发表评论</title>
		<link rel="stylesheet" type="text/css" href="../../css/weui.min.css">
		<link rel="stylesheet" href="../../css/mui.min.css" />
		<link rel="stylesheet" href="../../css/base.css"/>
		<style>
			body {
				background-color: rgba(100,100,100,0.6);
			}
			.setCenterDiv {
				position: absolute;
				background-color: #fff;
				margin-bottom: 10px;
				margin-left: 20px;
			}
			.jiangeDiv {
				height: 10px;
			}
			.inputTextareaDiv {
				margin-top: 10px;
			}
			#editNoteSpan {
				color: white;
				font-size: 16px;
			}
			#commitBtn {
				margin-right: 10px;
				color: #0CB800;
				visibility: hidden;
			}
			.tdImgSet img {
				width: 30px;
				height: 30px;
			}
			.dafenDiv {
				margin-top: 10px;
				width: 100%;
				clear: both;
				font-weight: lighter;
				margin-left: 60px;
			}
			#dafenSpan {
				float: left;
				display: block;
				line-height: 40px;
				font-size: 20px;
			}
			table {
				padding-left: 20px;
			}
			#successA {
				/*position: relative;*/
			}
			#commentTextarea {
				height: 100px;
			}
			#alertDiv {
				display: none;
			}
			#fabiaoBtn {
				margin-top: 20px;
				width: 80%;
			}
			:focus {
				outline: 0;
			}
			* {
				-webkit-tap-highlight-color: rgba(255,255,255,0);
			}
			input, textarea {
				-webkit-appearance: none;
				border-radius: 0;
			}
			/*	.weui_dialog {
			 z-index: -1;
			 /*top: 33%;*/
			/*}*/
		</style>
	</head>
	<body>
		<div class="showSelectListDiv " >
			<div class="setCenterDiv" style="border-radius:10px;">
				<div id="offlineAlert" class="weui_dialog_confirm" >
					<div class="weui_dialog">
						<div class="weui_dialog_hd">
							<strong class="weui_dialog_title">确定删除此评论？</strong>
						</div>
						<div class="weui_dialog_bd"></div>
						<div class="weui_dialog_ft">
							<a onclick="cleanCancel()" href="#" class="weui_btn_dialog default"  style="color:#18b4ed">取消</a>
							<a onclick="deleteComment()" href="#" class="weui_btn_dialog primary"  style="color:#18b4ed">确定</a>
						</div>
					</div>
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/jquery.min.js"></script>
	<script type="text/javascript" src="../../script/MD5.js"></script>
	<script type="text/javascript" src="../../script/requestTool.js"></script>
	<script src="../../script/common.js"></script>
	<script type="text/javascript" src="../../script/databaseOperation.js"></script>
	<script type="text/javascript">
		var sxtdScore = 0;
		var pid = "";
		// 计划id
		var cid = "";
		//课程id
		var id = "";
		//章节id
		DBReady = function() {
			//改变当前Frame宽高
			ChangeFrame();
			var pageParam = api.pageParam;
			id = pageParam.id;
			cid = pageParam.cid;
			$('input').blur(function() {
				$('.share').css('display', 'block');
			})
			//安卓手机系统返回键事件
			keyback();
		}
		function ChangeFrame() {
			$('.showSelectListDiv').css('height', api.frameHeight);
			var textWidth = api.frameWidth - 80;
			$api.css($api.dom('textarea'), 'width:' + textWidth + 'px;');
			// 设置居中
			$api.css($api.dom('.setCenterDiv'), 'top: ' + (api.frameHeight - 300) / 2 + 'px;width: ' + (api.frameWidth - 40) + 'px;');
		}

		//安卓手机系统返回键事件
		function keyback() {
			api.addEventListener({
				name : 'keyback'
			}, function(ret, err) {
				api.closeFrame({
					name : 'Study_CompetitiveProductsCommentDelete'
				});
			});
		}

		function cleanCancel() {
			api.closeFrame({
				name : 'Study_CompetitiveProductsCommentDelete'
			});
		}

		function deleteComment() {
			var param = {
				id : id,
				cid : cid,
				jid : $api.getStorage('cfnetppjxid'),
				uid : $api.getStorage('cfnetppuid'),
			};
			cfnetppPOST(url_delComment, param, true, function(data, status) {
				hideProgress();
				if (status == 'success') {
					if (data.code == 200) {
						ShowToast('删除成功');
						sendNotifi();
						api.closeFrame({
							name : 'Study_CompetitiveProductsCommentDelete'
						});
					} else {
						api.toast({
							msg : '删除失败',
							duration : 2000,
							location : 'bottom'
						});
					}
				} else {
					api.toast({
						msg : '获取数据失败',
						duration : 2000,
						location : 'bottom'
					});
				}
			});
		}

		function closeFrame() {
			api.closeFrame({
				name : 'Study_CompetitiveProductsCommentDelete'
			});
		}

		function sendNotifi() {
			api.sendEvent({
				name : 'refreshCPCommentListNotifi'
			});
		}
	</script>
</html>
